package main

import (
	"fmt"
	"time"
)
//从goroutine
func newTask()  {
	i := 0
	for  {
		i++
		fmt.Printf("new goroutine : i = %d\n",i)
		time.Sleep(1 * time.Second)
	}
}

//主 goroutine
func main() {
	//创建一个go程 去执行newTask()流程
	go newTask()

	fmt.Printf("main goroutine exit")
	/*
	i := 0
	for  {
		i++
		fmt.Printf("main goroutine : i = %d\n",i)
		time.Sleep(1 * time.Second)
	}
	*/
}